package org.xxx.epms.models.authority.controller;


import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Authorization;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import org.xxx.epms.models.authority.mapper.AdminPermissionMapper;
import org.xxx.epms.models.authority.model.AdminPermission;
import org.xxx.epms.models.epms.model.Admin;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lb
 * @since 2024-06-12
 */
@RestController
@RequestMapping("/authority/adminPermission")
public class AdminPermissionController {

    @Autowired
    private AdminPermissionMapper adminPermissionMapper;

    //测试AdminPermissionMapper中的selectByAdminId方法
    @RequestMapping("/selectByAdminId")
    @ApiOperation(value = "根据管理员ID查询权限", authorizations = {@Authorization(value = "bearer-key")})
    public List<AdminPermission> selectByAdminId(@RequestBody Admin admin){
        return adminPermissionMapper.selectByAdminId(admin.getAdminId());
    }

}

